//求表达式 f(n)结果末尾0的个数: https://www.nowcoder.com/exam/test/16546827/summary
#include <algorithm>
#include <iostream>
using namespace std;
// 计算i中包含因子n的个数
int calNumber(int num, int n) {
    int cnt = 0;
    while (num >= n && num % n == 0) 
    {
        ++cnt;
        num /= n;
    }
    return cnt;
}
// 计算所有2和5的个数，然后取最小
int main() 
{
    int n;
    cin >> n;
    int num2 = 0, num5 = 0;
    for (int i = 1; i <= n; i++) 
    {
        // 整个式子中包含的数字i共有：n + 1 - i个
        num2 += calNumber(i, 2) * (n + 1 - i);
        num5 += calNumber(i, 5) * (n + 1 - i);
    }
    cout << min(num2, num5) << endl;
    return 0;
}